<?php $this->JQuery()->javascriptCaptureStart()?>
$j(document).ready(function() {

	$j('.reverse_account').click(function() {
		var message = "是否确定你更改成为个人帐户？这可能会降低贵公司曝光率.";
		if (confirm(message)) {
			 return true;
		}
		 return false;
	});
	
	$j('.upgrade_account').click(function() {
		var message = "确定成为商业帐户吗？可以在我们的商业指南内，让您的业务有更多的曝光率.";
		if (confirm(message)) {
			 return true;
		}
		 return false;
	});
	
});

<?php $this->JQuery()->javascriptCaptureEnd()?>

<section class="tool">
	<section class="user info personal">
		<h3><?php echo $this->t('我的个人帐户')?><!--我的个人帐户--></h3>
		<figure>
			<a href="<?php echo $this->geturl('my-account-profile', 'user')?>">
				<img src="<?php echo $this->thumbnail()->scale($this->loggedin_user->profile_picture, 128, 128, true, true);?>" id="profile_profile_pic_img">
				<figcaption><?php echo $this->t('更改个人图像')?><!--更改个人图像--></figcaption>
			</a>
		</figure>
		<h2><?php echo $this->loggedin_user->name?></h2>
		<ul>
		<?php if (!empty($this->loggedin_user->cid)):?>
            <li><a href="<?php echo $this->geturl('my-account-following', 'user')?>"><span><?php echo $this->t('关注')?><!--关注--></span><?php echo (int)$this->loggedin_user->company->count_following;?></a></li>
            <li><a href="<?php echo $this->geturl('my-account-follower', 'user')?>"><span><?php echo $this->t('粉丝')?><!--粉丝--></span><?php echo (int)$this->loggedin_user->company->count_followers;?></a></li>
            <li><a href="<?php echo $this->geturl('my-account-like', 'user')?>"><span><?php echo $this->t('被喜欢')?><!--被喜欢--></span><?php echo (int)$this->loggedin_user->company->count_likes?></a></li>
        <?php else:?>
            <li><a href="<?php echo $this->geturl('my-account-following', 'user')?>"><span><?php echo $this->t('关注')?><!--关注--></span><?php echo (int)$this->loggedin_user->count_following;?></a></li>
            <li><a href="<?php echo $this->geturl('my-account-follower', 'user')?>"><span><?php echo $this->t('粉丝')?><!--粉丝--></span><?php echo (int)$this->loggedin_user->count_followers;?></a></li>
            <li><a href="<?php echo $this->geturl('my-account-like', 'user')?>"><span><?php echo $this->t('被喜欢')?><!--被喜欢--></span><?php echo (int)$this->loggedin_user->count_likes?></a></li>
        <?php endif;?>
		</ul>
		<p><?php echo $this->t('注册日期<em>__1__</em>', null, date(MEDIUM_DATE_FORMAT, $this->loggedin_user->created_at))?><!--注册日期--></p>
	</section>
	<dl>
		<dt><?php echo $this->t('我的资料')?><!--我的资料--></dt>
		<dd <?php echo ($this->select == 'home') ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account', 'user')?>"><?php echo $this->t('基本情况')?><!--基本情况--></a></dd>
		<dd <?php echo ($this->select == 'my-ad') ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-ads', 'user')?>"><?php echo $this->t('发布的信息');?><!--发布的信息--></a></dd>
		<dd <?php echo ($this->select == 'profile') ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-profile', 'user')?>"><?php echo $this->t('帐户资料');?><!--帐户资料--></a></dd>
		<dd <?php echo ($this->select == 'account') ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-account', 'user')?>"><?php echo $this->t('帐户设定');?><!--帐户设定--></a></dd>
	<?php if($this->loggedin_user->type & Model_User::PERSONAL):?>
		<dd <?php echo ($this->select == 'upgrade') ? 'class="selected"' : ''?>><a class="upgrade_account" href="<?php echo $this->geturl('my-account-upgrade', 'user')?>"><?php echo $this->t('升级换至商业帐户');?><!--升级换至商业帐户--></a></dd>
	<?php else: ?>
		<dd <?php echo ($this->select == 'reverse') ? 'class="selected"' : ''?>><a class="reverse_account" href="<?php echo $this->geturl('my-account-reverse', 'user')?>"><?php echo $this->t('转换至个人帐户');?><!--转换至个人帐户--></a></dd>
	<?php endif;?>
	</dl>
</section>
<?php //$this->headLink()->appendStylesheet(Ac_Util::getImageBaseUrl('/css/custom_my_acc.v-'.AC_VERSION.'.css'))?>
<?php /*$this->placeholder('grid-size')->set(12)?>
<?php $this->placeholder('aside-class')->set('-');?>
<section class="profile grid_3">
	<section class="personal">
    <h2><?php echo $this->t('My Account')?></h2>
    <figure id="profile_profile_pic">
    	<a href="<?php echo $this->geturl('my-account-profile', 'user')?>">
        	<img src="<?php echo $this->thumbnail()->resizeAndCrop($this->loggedin_user->profile_picture, 168, 150);?>" id="profile_profile_pic_img">
        </a>
    </figure>

	<h1><?php echo $this->loggedin_user->username?></h1>

    <p><?php echo $this->t('Active Since <em>__1__</em>', null, date(MEDIUM_DATE_FORMAT, $this->loggedin_user->created_at))?></p>
	</section>
    <?php if($this->loggedin_user->type & Model_User::COMPANY_ADMIN):?>
       <section class="company">
            <figure>
                <a href="<?php echo $this->geturl('my-company-profile', 'user')?>"><img src="<?php echo $this->thumbnail()->scale($this->loggedin_user->company->image, 180, 80, true, true);?>"></a>
            </figure>
            <p><a href="<?php echo $this->loggedin_user->company->url();?>"><?php echo $this->loggedin_user->company->company_name?></a></p>
        </section>
    <?php endif;?> 
	<dl>
		<dt><?php echo $this->t('Me')?></dt>
		<dd>
			<ul>
				<li <?php echo $this->select == 'home' ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account', 'user')?>"><?php echo $this->t('Home')?></a></li>
				<li <?php echo $this->select == 'my-ad' ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-ads', 'user')?>"><?php echo $this->t('Ads');?></a></li>
				<li <?php echo $this->select == 'profile' ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-profile', 'user')?>"><?php echo $this->t('Profile');?></a></li>
				<li <?php echo $this->select == 'account' ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-account-account', 'user')?>"><?php echo $this->t('Account Settings');?></a></li>
				<?php if($this->loggedin_user->type & Model_User::PERSONAL):?>
				<li <?php echo $this->select == 'upgrade' ? 'class="selected"' : ''?>><a class="upgrade_account" href="<?php echo $this->geturl('my-account-upgrade', 'user')?>"><?php echo $this->t('Change to Business Account');?></a></li>
				<?php else: ?>
				<li <?php echo $this->select == 'reverse' ? 'class="selected"' : ''?>><a class="reverse_account" href="<?php echo $this->geturl('my-account-reverse', 'user')?>"><?php echo $this->t('Change to Personal Account');?></a></li>
				<?php endif;?>
			</ul>
		</dd>
		<?php if($this->loggedin_user->type & Model_User::COMPANY_ADMIN):?>
		<dt><?php echo $this->t('My Company')?></dt>
		<dd>
			<ul>
				<li <?php echo $this->select == 'company' ? 'class="selected"' : ''?>><a href="<?php echo $this->geturl('my-company-profile', 'user')?>"><?php echo $this->t('Business Directory');?></a></li>
			</ul>
		</dd>
		<?php endif; ?>
	</dl>
	<!--
	<p class="button">
		<span>Connect with </span>
		<a class="google" href="<?php echo $this->geturl('google','user')?>"><em><?php echo $this->t('Connect with Google')?></em></a>
		<a class="yahoo" href="<?php echo $this->geturl('yahoo','user')?>"><em><?php echo $this->t('Connect with Yahoo')?></em></a>
		<a class="facebook" href="<?php echo $this->geturl('facebook','user')?>"><em><?php echo $this->t('Connect with Facebook')?></em></a>
	</p>
	-->
</section>
<?php echo */?>